// pages/food/food.js
Page({
    data:{
        productLink:[
            {
                picture:'/images/格子衬衫.jpg',
                intro:'浅蓝色高腰微喇叭牛仔裤',
                price:'99'
            }
        ]
    },
    queryRecommend() {
        var that = this;
          wx.request({
              url: 'http://localhost:8080/category/search?category=1',
              method:'POST',
              header:{
                  'content-type':'application/json'
              },
              success:function(res) {
                  console.log(res);
                  that.setData({
                      productLink:res.data.data,
                  });
              },
              fail:function() {
                  console.log("失败");
              }
          })
      },
      jumpSearch(){
        wx.navigateTo({
          url: '/pages/search one/search one',
        })
    },
    jumpRecommend(){
        wx.reLaunch({
          url: '/pages/desktop/sort/sort',
        })
    },
    jumpFood(){
        wx.reLaunch({
          url: '/pages/desktop/food/food',
        })
    },
    jumpClothes(){
        wx.reLaunch({
          url: '/pages/desktop/clothes/clothes',
        })
    },
    jumpIntro(e){
        var that = this;
        var item = e.currentTarget.dataset.index;
        wx.navigateTo({
          url: '/pages/product information/product information?proId='+item.pro_id,
        })
    },
    onShow: function () {
        this.queryRecommend();
     },
})